Parameters m.Servico

Private ltalk, areant, valch, preco, matser

if set('Talk') = 'ON'
   set talk off
   ltalk = .t.
  else
   ltalk = .f.
endif

m.areant = select()

Select 0
Use Servicos Again Alias ServTmpTipo
    set order to tag Codigo
    
Seek m.Servico

m.TipoPreco = ServTmpTipo.TipoPreco
m.MatSer    = ServTmpTipo.MatSer
use

if (m.TipoPreco=0) 
   m.TipoPreco = 1
endif

if (m.TipoPreco=2) or (m.MatSer='T') or (m.MatSer='M')
   m.TipoPreco = 2
endif

Select (m.Areant)

if ltalk
   set talk on
endif

return (m.TipoPreco)
